/*
 * @Author: Lin Hongwei
 * @Date: 2021-12-02 15:57:14
 * @LastEditTime: 2021-12-05 13:51:06
 * @LastEditors: Lin Hongwei
 * @email: 1365755396@qq.com
 * @CSDN: https://blog.csdn.net/weixin_45429409
 * @Description: 开发环境配置
 */
const BaseConfig = require("./webpack.config.js");
const {merge:WebpackMerge} = require("webpack-merge");


const path = require("path");
//打包前清除已经打包的
// const {CleanWebpackPlugin} = require("clean-webpack-plugin");

//引入webpack插件
const Webpack = require('webpack');
const DevConfing = {
    mode: "development",
    devtool:"eval-cheap-module-source-map",
    //插件
    plugins: [
        //清除
        // new CleanWebpackPlugin(), 
        //热模块替换插件,webpack5自动引入
        // new Webpack.HotModuleReplacementPlugin(),
    ],
    //热部署
    devServer:{
        //静态资源的根目录
        // contentBase:path.join(__dirname, 'dist'),//webpack5移除用static
        static:path.join(__dirname, 'dist'),
        host:"localhost",
        port:8848,
        open:true,
        // hot:true,//模块热替换,webpack5自动开启
    },
    target:"web"
}


module.exports = WebpackMerge(BaseConfig,DevConfing)